home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-02-26 | 976 b | 33 lines | [TEXT/PJMM] |
- program ICEmailAddress;
- (* The simplest IC aware program. It simply outputs *)
- (* the user's preferred Email address. *)
-
- uses
- ICTypes, ICAPI, ICKeys; (* standard IC interfaces *)
-
- var
- instance: ICInstance;
- (* opaque reference to IC session *)
- str: Str255;
- (* buffer to read Email address into *)
- str_size: longint;
- (* size of above buffer *)
- junk: ICError;
- (* place to throw away error results *)
- junk_attr: ICAttr;
- (* place to throw away attributes *)
- begin
- (* start IC *)
- if ICStart(instance, '????') = noErr then begin
- (* specify a database, in this case the default one *)
- if ICFindConfigFile(instance, 0, nil) = noErr then begin
- (* read the real name preferences *)
- str_size := sizeof(str);
- if ICGetPref(instance, kICEmail, junk_attr, @str, str_size) = noErr then begin
- writeln(str);
- end; (* if *)
- end; (* if *)
- (* shut down IC *)
- junk := ICStop(instance);
- end; (* if *)
- end. (* ICEmailAddress *)